<?php
include './header.inc.php';

//Datenbankkonfiguration
include 'sql_config.php';

include './navbar.inc.php';
?>
<script>
    $("#link1").removeClass("active");
    $("#link2").removeClass("active");
    $("#link3").addClass("active");
    $("#link4").removeClass("active");
    $("#link5").removeClass("active");
</script>


<!------------------------------------------------------------------------------
# Menuebereich
STATUS: erster Prototype,
- mit Tabellen und Datensätzen aus einer kleinen Testdatenbank
- Design ist Responsiv und somit für mobile Devices geeignet (mit Optimierungsbedarf)

Nächste Implementierung:
- Suchfunktion einbinden
- Design optimieren
- Testdatenbank könnte durch eine bereits existierende DB der HWR ersetzt werden
------------------------------------------------------------------------------->

<div class="text-left">
    <div class="panel panel-default">
        <!-- Standard-Panel-Inhalt -->
        <div class="panel-heading"id="toggleLeiste1"><span id="pfeil1" class="glyphicon glyphicon-chevron-right"></span>     Büros</div>
        <div id="toggleContent1">
            <div class="panel-body">
                <p>Navigiere direkt zu Büros von Dozenten und Verwaltungsangestellten.</p>
                <p>Telefon-Vorwahl: +49 (0)30-<br>E-Mail: ...@hwr-berlin.de </p>
            </div>

            <!-- Tabelle -->
            <div class="table-responsive">
                <table class="table table-striped">
                    <tr>
                        <th>Name</th>
                        <th>Fachbereich</th>
                        <th>Professur/ Funktion</th>
                        <th>Kontakt</th>
                        <th>Haus</th>
                        <th>Raum</th>
                        <th>Navi</th>
                    </tr>

                    <?php
                    $resultO = mysqli_query($connecttion, 'SELECT * FROM `office` ORDER BY `name`');
                    while ($entry = mysqli_fetch_array($resultO)) {
                        ?>
                        <tr>
                            <td><a href="<?php echo $entry['maplink'] ?>" style="color: black;"><?php echo utf8_encode($entry['name']) ?></a></td>
                            <td><?php echo nl2br(utf8_encode($entry['fachbereich'])) ?></td>
                            <td><?php echo nl2br(utf8_encode($entry['professur'])) ?></td>
                            <td><?php echo nl2br($entry['kontakt']) ?></td>
                            <td class="text-center"><?php echo $entry['haus'] ?></td>
                            <td class="text-center"><?php echo $entry['raum'] ?></td>
                            <td class="text-center"><a href="<?php echo $entry['maplink'] ?>" type="button" class="btn btn-default glyphicon glyphicon-chevron-right"></a></td>
                        </tr>
                        <?php
                    }
                    ?>
                </table>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <!-- Standard-Panel-Inhalt -->
        <div class="panel-heading" id="toggleLeiste2"><span id="pfeil2" class="glyphicon glyphicon-chevron-right"></span>     Vorlesungsräume</div>
        <div id="toggleContent2">
            <div class="panel-body">
                <p>Nie mehr suchen! Hier findest du alle Räume, des Campus Lichtenberg, der HWR Berlin.</p>
            </div>

            <!-- Tabelle -->
            <div class="table-responsive">
                <table class="table table-striped">
                    <tr>
                        <th>Raum</th>
                        <th>Haus</th>
                        <th>Art</th>
                        <th>Verantwortliche</th>
                        <th>Hinweise</th>
                        <th>Navi</th>
                    </tr>

                    <?php
                    $resultR = mysqli_query($connecttion, 'SELECT * FROM `room` ORDER BY `raum`');

                    while ($entry = mysqli_fetch_array($resultR)) {
                        ?>
                        <tr>
                            <td><a href="<?php echo $entry['maplink'] ?>" style="color: black;"><?php echo $entry['raum'] ?></a></td>
                            <td class="text-center"><?php echo $entry['haus'] ?></td>
                            <td class="text-center"><?php echo $entry['art'] ?></td>
                            <td><?php echo nl2br(utf8_encode($entry['verantwortliche'])) ?></td>
                            <td><?php echo nl2br(utf8_encode($entry['hinweise'])) ?></td>
                            <td class="text-center"><a href="<?php echo $entry['maplink'] ?>" type="button" class="btn btn-default glyphicon glyphicon-chevron-right"></a></td>
                        </tr>
                        <?php
                    }
                    ?>
                </table>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <!-- Standard-Panel-Inhalt -->
        <div class="panel-heading"  id="toggleLeiste3"><span id="pfeil3" class="glyphicon glyphicon-chevron-right"></span>     Sonderziele</div>
        <div id="toggleContent3">
            <div class="panel-body">
                <p>Die nächste Toliette oder der nächste Ausgang? Kein Problem es ist alles ganz nahe.</p>
            </div>

            <!-- Tabelle -->
            <div class="table-responsive">
                <table class="table table-striped">
                    <tr>
                        <th>Sonderziel</th>
                        <th>Raum</th>
                        <th>Haus</th>
                        <th>Hinweise</th>
                        <th>Navi</th>
                    </tr>
                    <?php
                    $resultS = mysqli_query($connecttion, 'SELECT * FROM `spezial` ORDER BY ID');

                    while ($entry = mysqli_fetch_array($resultS)) {
                        ?>
                        <tr>
                            <td><a href="<?php echo $entry['maplink'] ?>" style="color: black;"><?php echo utf8_encode($entry['sonderziel']) ?></a></td>
                            <td class="text-center"><?php echo $entry['raum'] ?></td>
                            <td class="text-center"><?php echo $entry['haus'] ?></td>
                            <td><?php echo nl2br(utf8_encode($entry['hinweise'])) ?></td>
                            <td><a href="<?php echo $entry['maplink'] ?>" type="button" class="btn btn-default glyphicon glyphicon-chevron-right"></a></td>
                        </tr>
                        <?php
                    }
                    ?>
                </table>
            </div>
        </div>
    </div>
</div>


<?php
include './footer.inc.php';
